package com.company.cloud.mall.modules.api.response;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;


import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class OrderModel {

	
	@ApiModelProperty(value = "流水号")
	private String sn;

	@ApiModelProperty(value = "公司编号")
	private String companyNo;
	
	@ApiModelProperty(value = "公司名称")
	private String companyName;

	@ApiModelProperty(value = "主公司编号")
	private String mainCompanyNo;
	
	@ApiModelProperty(value = "主公司名称")
	private String mainCompanyName;

	@ApiModelProperty(value = "用户ID")
	private Integer userId;
	
	@ApiModelProperty(value = "用户名")
	private String userName;

	@ApiModelProperty(value = "用户昵称")
	private String userNickName;

	@ApiModelProperty(value = "用户真实姓名")
	private String userRealName;

	@ApiModelProperty(value = "用户头像")
	private String userHeadImg;

	@ApiModelProperty(value = "推荐码")
	private String referralCode;

	@ApiModelProperty(value = "推荐人用户ID")
	private Integer referralUserId;

	@ApiModelProperty(value = "订单分类")
	private String orderType;

	@ApiModelProperty(value = "下单时间")
	private LocalDateTime orderDate;

	@ApiModelProperty(value = "过期时间")
	private LocalDateTime orderExpire;

	@ApiModelProperty(value = "订单金额（商品金额+税金+支付手续费+运费-）")
	private BigDecimal fund;

	@ApiModelProperty(value = "商品金额")
	private BigDecimal productFund;

	@ApiModelProperty(value = "订单参数")
	private String orderParam;

	@ApiModelProperty(value = "订单状态")
	private String status;

	@ApiModelProperty(value = "是否已兑换积分")
	private String isExchangePoint;

	@ApiModelProperty(value = "兑换积分")
	private Integer exchangePoint;

	@ApiModelProperty(value = "是否已赠送积分")
	private String isRewardPoint;

	@ApiModelProperty(value = "赠送积分")
	private Integer rewardPoint;

	@ApiModelProperty(value = "是否已使用优惠码")
	private String isUseCouponCode;

	@ApiModelProperty(value = "优惠码")
	private String couponCode;

	@ApiModelProperty(value = "优惠码折扣金额")
	private BigDecimal couponDiscountFund;

	@ApiModelProperty(value = "用户留言")
	private String userMemo;

	@ApiModelProperty(value = "支付方式")
	private String paymentMethod;

	@ApiModelProperty(value = "支付手续费")
	private BigDecimal paymentFee;

	@ApiModelProperty(value = "支付金额")
	private BigDecimal paymentFund;

	@ApiModelProperty(value = "支付状态")
	private String paymentState;

	@ApiModelProperty(value = "支付时间")
	private LocalDateTime payDate;

	@ApiModelProperty(value = "配送方式")
	private String shippingMethod;

	@ApiModelProperty(value = "运费")
	private BigDecimal freight;

	@ApiModelProperty(value = "收货人姓名")
	private String consigneeName;

	@ApiModelProperty(value = "收货人电话")
	private String consigneePhone;

	@ApiModelProperty(value = "收货人省份")
	private String consigneeProvince;

	@ApiModelProperty(value = "收货人城市")
	private String consigneeCity;

	@ApiModelProperty(value = "收货人地区")
	private String consigneeRegion;

	@ApiModelProperty(value = "收货人街道")
	private String consigneeStreet;

	@ApiModelProperty(value = "收货人详细地址")
	private String consigneeAddr;

	@ApiModelProperty(value = "是否需要发票")
	private String isInvoice;

	@ApiModelProperty(value = "发票类型")
	private String invoiceType;

	@ApiModelProperty(value = "发票抬头")
	private String invoiceTitle;

	@ApiModelProperty(value = "发票税号")
	private String invoiceTaxNo;

	@ApiModelProperty(value = "发票内容")
	private String invoiceContent;

	@ApiModelProperty(value = "是否已分配库存")
	private String isAllocatedStock;

	@ApiModelProperty(value = "退款金额")
	private BigDecimal refundFund;

	@ApiModelProperty(value = "审核时间")
	private LocalDateTime checkDate;

	@ApiModelProperty(value = "发货时间")
	private LocalDateTime shippingDate;

	@ApiModelProperty(value = "收货时间")
	private LocalDateTime receivingDate;

	@ApiModelProperty(value = "完成时间")
	private LocalDateTime completeDate;

	@ApiModelProperty(value = "关闭时间")
	private LocalDateTime closeDate;

	@ApiModelProperty(value = "订单处理时间")
	private LocalDateTime handleDate;

	@ApiModelProperty(value = "订单处理人")
	private Integer handleUserId;

	@ApiModelProperty(value = "订单处理留言")
	private String handleMemo;

	@ApiModelProperty(value = "使用人姓名")
	private String useUserName;

	@ApiModelProperty(value = "使用人手机号码")
	private String useUserMobile;

	@ApiModelProperty(value = "兑换码")
	private String exchangeCode;

	@ApiModelProperty(value = "是否有分销商品")
	private String isDisProduct;

	@ApiModelProperty(value = "用户删除状态")
	private String userDelState;

	@ApiModelProperty(value = "订单明细")
	private List<OrderItemModel> items;

	@ApiModelProperty(value = "订单支付明细")
	private List<OrderPayModel> payItems;

	@ApiModelProperty(value = "订单发货明细")
	private List<OrderShippingModel> shippings;

	public void addItem(OrderItemModel item) {
		if (this.items == null) {
			this.items = new ArrayList<OrderItemModel>();
		}
		if (item != null) {
			this.items.add(item);
		}
	}

	public void addItem(OrderShippingModel item) {
		if (this.shippings == null) {
			this.shippings = new ArrayList<OrderShippingModel>();
		}
		if (item != null) {
			this.shippings.add(item);
		}
	}

	public void addItem(OrderPayModel item) {
		if (this.payItems == null) {
			this.payItems = new ArrayList<OrderPayModel>();
		}
		if (item != null) {
			this.payItems.add(item);
		}
	}

	
	
}
